package com.tang.officedemo.word.poi_tl;

import com.deepoove.poi.XWPFTemplate;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;

/**
 * @author tangfl
 */
public class PoiTlExample {

    public static void main(String[] args) throws IOException {
        XWPFTemplate template = XWPFTemplate.compile("src/main/resources/template/template.docx").render(new HashMap<String, Object>() {{
            put("title", "我是一个标题");
        }});
        FileOutputStream out = new FileOutputStream("src/main/resources/template/out_template.docx");
        template.write(out);
        out.flush();
        out.close();
        template.close();
    }

}
